The present invention relates to an optical communication system and, particularly, to a system for bringing the states of buses into agreement when the two electric buses in a network are connected together through optical fibers.
A field LAN for industrial use is installed on a field and is subject to be affected by electromagnetic noise from power cables and by lightning. If an optical fiber which is a noise-resistant transmission medium is used instead of an electric cable, therefore, it becomes possible to bury the power line and the control LAN in the same channel. Generally, however, the optical transmission devices are more expensive than the electric transmission equipment. When the whole apparatus is connected by using optical fibers, therefore, the system cost is driven up. On the other hand, the optical transmission equipment is used only in limited places in the system. Therefore, if the places where expensive optical transmission devices are used are limited, then, the cost of the system can be suppressed.
To meet this demand, Hitachi, Ltd. has put into practical use an optical linking device (LWZ440) for a program controller (S10/2 xcex1) in which the electric buses are partly replaced by optical fibers, and both ends of the optical fibers are connected to the electric buses via photo-electric conversion devices.
In a system using the controller S10/2 xcex1 and the device LWZ440, the master of the control LAN is limited to only one controller and, hence, a signal that flows into the control LAN is either from master to slave or from slave to master. Therefore, the optical linking device LWZ440 changes over the direction of transmission in a unit of a packet transfer to realize the transmission of data between the master and the slave.
A conventional control system, in which the electric buses are partly replaced by optical fibers, is constituted by a master that outputs an instruction to the control LAN and a plurality of slaves that operate upon receiving the instruction. This is because, when there exist many masters, the control LAN itself must have an arbitration function to simultaneously output control data (instructions) to the control LAN, and it becomes difficult to exchange the data in a predetermined period in real time.
However, when the master is a controller, even a manual operation cannot be accomplished from the operation board in case the controller becomes defective. Therefore, an instruction system had to be separately provided to halt the whole system in case of emergency.
To solve this problem, a multi-master system is required enabling a plurality of nodes connected to the control LAN to become masters. An ISO11898 standard is one of the transfer systems that corresponds to the multi-master system.
According to the transfer system of the ISO11898 standard as disclosed in Japanese Patent Laid-Open No. 236333/1994, a plurality of nodes are connected using serial lines of the form of buses, enabling the data to be simultaneously outputted to the LAN from a plurality of nodes. According to this standard, furthermore, the data are transferred as every node outputs data to the serial line and detects the state of the bus repetitively for every bit. Moreover, each node drives the bus at the time when a logic 0 is outputted to the serial line but does not drive the bus when a logic 1 is outputted, in order to transfer the data bit by bit. Thus, even with one node, the bus assumes the state of logic 0 when the logic 0 is outputted.
Therefore, every node detects the state of the bus after the data is outputted. At this moment, the value outputted to the bus is compared with the state of the bus and when they are not in agreement, the node no more outputs the data. Thus, the nodes successively interrupt the transmission of packet, thereby executing the arbitration.
In a system based on the ISO11898 standard, unlike the conventional system of a single master, the states of all buses must be brought into agreement while a bit is being transferred. In a system which changes over the direction of transmission using optical fibers in a unit of a packet as in the above-mentioned optical linking device (LWZ440), therefore, it is not allowed to bring the states of electric buses at both ends of the optical fiber into agreement.
It is therefore presumed that the state of one electric bus is transmitted to the driven state, a logic 0 state, the driven state outputted by a logic 0 of another electric bus via an optical fiber. Optical bus-bridging devices attached to both ends of the optical fiber observe the states of the electric buses to which they are connected, produce an optical output upon confirming that the electric bus is being driven, and transmit it to the other optical bus-bridging device via the optical fiber. Upon detecting an optical input from the optical fiber, the other bus-bridging device drives the electric bus. Thus, the drive state of the one electric bus is transmitted to the other electric bus via the optical fiber.
However, when the transmission of the state of the bus and the response are executed in two directions in the optical linking devices by using two optical fibers to realize a multi-master system, there may often be formed an optical loop by the two optical linking devices and the optical fibers, resulting in the occurrence of a xe2x80x9cdeadlocked situationxe2x80x9d or a xe2x80x9ccrossing situationxe2x80x9d as described below, making it difficult to properly bring the states into agreement.
FIG. 17 illustrates a problem stemming from the optical linking devices of two directions. In this system, a node 1 and a node 2 drive the electric buses a and b to which they are connected. Optical linking devices a and b are connected to both ends of the optical fibers, the optical linking device a being connected to the bus a and the optical linking device b being connected to the bus b. The optical linking devices a and b output light to the optical fibers when the electric buses to which they are connected are driven. Conversely, when light is inputted from the optical fibers, the optical linking devices a and b drive the electric buses to which they are connected.
(1) It is now presumed that none of the two electric buses a and b have been driven in the initial state. In this case, none of the buses a and b are driven, and none of the optical linking devices a and b are producing optical output to the optical fiber, maintaining a stable state.
(2) In this state, the node 1 connected to the bus a drives the bus a.
(3) Upon detecting the fact that the bus a is driven, the optical linking device a produces an optical output to the optical fiber. Upon receiving this optical output, the optical linking device b starts driving the bus b.
(4) The bus b is driven by the optical linking device b, and the node 2 detects the fact that the bus b is being driven. Since the bus b is in a state in which it is being driven, the optical linking device b produces optical output to the optical fiber. Accordingly, the optical linking device a starts driving the bus a.
(5) Next, the node 1 no longer drives the bus a. However, since the optical linking device a continues to drive the bus a, the bus a is maintained driven. Both, the bus a and the bus b remain stable in a state of being driven. Thus, a large latch loop is formed by the two optical fibers and two optical linking devices. Finally, therefore, the buses a and b remain stable in a state of being driven despite their being driven by none of the nodes, resulting in the occurrence of a so-called xe2x80x9cdeadlocked situationxe2x80x9d.
Moreover, when the two electric buses a and b are driven to assume the ON state during a transfer cycle, the optical linking devices a and b, respectively, judge that the buses of their own sides are turned ON and work to produce optical outputs to the optical fibers in an effort to turn the buses of the other sides ON, establishing a xe2x80x9ccrossing situationxe2x80x9d. In the xe2x80x9ccrossing situationxe2x80x9d, the bus drive signals of the optical linking devices a and b are exchanged between the two buses; i.e., the buses a and b vibrate in repeating ON/OFF state.
The object of the present invention is to provide an optical communication method, optical linking devices and an optical communication system which are free from the above-mentioned problems inherent in the prior art, and are capable of bringing into proper agreement the driven states of the two electric buses connected together through optical fibers, and in which a plurality of nodes are allowed to simultaneously drive the buses.
The present invention is further concerned with a bus system in which two electric buses are linked together through optical fibers, wherein a mode of producing an optical output to the optical fiber is separated from a mode of producing an electric output to the electric bus, in order to prevent the formation of the above-mentioned optical loop.
The above-mentioned object is accomplished by an optical communication method in which the states of the two electric buses connected through optical fibers are brought into agreement, wherein:
the states of said electric buses and the states of said optical fibers are observed while said electric buses are not being driven (OFF state);
while one or both of said electric buses are being driven (ON state) by the nodes connected thereto, an optical output is continuously produced from the buses that are being driven to said optical fibers;
while light has been inputted from said optical fibers, the states of said buses are not observed, but an electric output is produced to the electric bus of the side to which light is inputted to drive the bus; and
when the buses are no longer driven by said nodes, said optical outputs and said electric outputs are halted, and said electric buses are no longer driven.
This makes it possible to reliably avoid the above-mentioned deadlocked situation.
Furthermore, at the time of being shifted to the non-driven mode by no longer producing the electric output, a state is passed through in which said electric buses are not observed for only a predetermined period of time. Therefore, even when the optical bus-bridging devices are no longer driving the electric buses, a transient ON state is not erroneously regarded the bus as driven despite the state of the electric bus has transiently changed from ON state to OFF state, and erroneous operation is avoided. The above-mentioned predetermined period is longer than a transient period. This transient period is determined by the characteristics of the means for driving the buses, and can be set irrespective of the transfer distance inclusive of optical fibers and electric buses or the data transfer rate.
When both of said electric buses are driven by the respective nodes and when optical outputs are sent to said optical fibers from both sides, one side discontinues the production of said optical output and produces said electric output only. This eliminates the above-mentioned xe2x80x9ccrossing situationxe2x80x9d.
The invention further deals with optical linking devices (optical bus-bridging devices) for realizing the optical communication method of the present invention, installed among the optical fibers for connecting the two electric buses and said electric buses in order to bring the states of the two electric buses into agreement, comprising a means which executes a standby mode for observing the states of the buses and the states of the optical fibers when said electric buses are not being driven (OFF state), an optical output mode shifted from said standby mode when said electric buses are driven (ON state) by the nodes to which they are connected, in order to produce an optical output to said optical fibers, a bus drive mode for producing an electric output to the electric bus of its own side when an optical input is received from said optical fibers, and a non-observation mode which, when the buses are no longer driven by said nodes, inhibits the observation of the states of the buses for a predetermined period of time at the time when said bus drive mode is shifted to said standby mode, wherein said means changes over these modes depending upon the states of the buses.
Provision is further made of a mode shift signal-setting means for shifting one of the two optical bus-bridging devices into the bus drive mode when the two electric buses are driven by the nodes and when the two optical bus-bridging devices provided on both sides of said optical fibers are simultaneously changed over to said optical output mode.
The invention is further concerned with an optical communication system to which the optical linking devices of the invention are adapted, comprising electric buses having two electrical states, a plurality of nodes for outputting two-value data to said electric buses, optical linking devices having means for converting electric signals into optical signals and means for converting optical signals into electric signals, and an optical fiber for connecting said two electric buses together via said optical linking devices, wherein:
said optical fiber includes two optical fibers through which said optical linking devices execute optical output and optical input separately in order to transmit the states of said electric buses in two directions;
said optical linking devices have a function for observing the ON/OFF state of said electric buses and the presence/absence of optical input from said optical fibers, for producing optical outputs to said optical fibers when said electric bus is because optical linking devices are connected only one electric bus in the ON state, and for producing an electric output to the electric bus of its own side when an optical input is received from said optical fibers, and a function for halting the optical output of one side and for producing said electric output only when said two optical fibers have simultaneously produced said optical outputs giving rise to the occurrence of an optical loop situation; and
when said electric buses are driven for each of the transmission cycles depending upon the ON/OFF of a bit data from said node, the driven states of the two electric buses are brought into agreement via said optical fibers and said optical linking devices on both sides thereof, and after the states have been brought into agreement, said nodes execute the sampling of said electric buses.
When said data are simultaneously outputted from said plurality of nodes to said electric buses, the states of said buses are necessarily determined to be a preferential state, and every node compares the state in which it has produced an output to said electric bus with the state of said electric bus and determines whether the data be continuously outputted to said electric bus or not.
FIG. 18 illustrates the steps for bringing the driven states of the electric buses into agreement according to the present invention.
(1) It is first presumed that none of the two electric buses a and b have been driven in the initial state. In this case, the optical bus-bridging devices a and b are both in the standby mode.
(2) Next, a node 1 connected to the bus a drives the bus a.
(3) The optical bus-bridging device a detects the fact that the bus a is driven, shifts the mode from the standby mode into the optical output mode, and produces an optical output to the optical fiber. Upon receiving the optical output, the optical bus-bridging device b shifts the mode from the standby mode to the bus drive mode and starts driving the bus b. In the bus drive mode, no bus is observed.
(4) As a result, the bus b is driven, and the states of the two buses a and b are brought into agreement. The node 2 fetches the driven state of the bus b, and the transmission of a bit from the node 1 to the node 2 ends.
(5) Next, the node 1 no longer drives the bus a. Thus, the optical bus-bridging device a is shifted from the optical output mode to the standby mode and no longer produces optical output to the optical fibers. In response to this, the optical bus-bridging device b is shifted from the bus drive mode to the standby mode.
Thus, one of the optical bus-bridging devices is shifted to the optical output mode and the other one is shifted to the bus drive mode to avoid the occurrence of the deadlocked situation caused by the formation of an optical loop.
In (5) above, a non-observation mode of a predetermined period of time is passed through when the optical bus-bridging device b is shifted from the bus drive mode to the standby mode. This prevents the optical bus-bridging devices from being erroneously operated.
When the two optical bus-bridging devices simultaneously assume the optical output mode, furthermore, the device of the side in which a mode transition signal (MODE) has been set in advance changes the optical output mode over to the bus drive mode.
In practice, a bus is driven by a node in compliance with the ISO11898 standard for every period for transferring a bit. Therefore, the two optical bus-bridging devices need not simultaneously share the optical output mode but only one of them may have the optical output mode.
In order to accomplish the above-mentioned object, furthermore, the present invention deals with a data processing system comprising:
a first bus transferring voltage;
a second bus transferring voltage;
a plurality of computers connected to said first bus or said second bus, detect the state of the bus to determine whether the transmission can be effected or not, and transmit and receive messages; and
a first bus-bridging device connected between said first bus and a third bus in order to connect said first bus to said second bus through said the third bus using light, and a second bus-bridging device connected between said second bus and said third bus;
wherein said first and second bus-bridging devices have a function for detecting whether a signal input from the third bus is the signal output from the first and the second bus-bridging devices themselves or not.
In order to accomplish the above-mentioned object, furthermore, the present invention comprises:
a bus driver circuit connected to a first bus that uses transfers voltage and exchanges the signals relative to said first bus;
a conversion circuit connected to a second bus using transferring light and outputs optical signals to said first bus; and
a state-of-the-bus judging circuit which receives a signal representing the state of said first bus sent from said bus driver circuit and a signal representing the state of said second bus sent from said conversion circuit, determines the state of said first bus based upon a change in the signal representing the state of said first bus and upon a change in the state of said second bus, and sends an output to said bus driver.